<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <input id="c-id" class="hidden" value="{$row.id}">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Device_code')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-device_code" data-rule="required" class="form-control" name="row[device_code]" type="text" value="{$row.device_code|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Device_pwd')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-device_pwd" data-rule="required" class="form-control" name="row[device_pwd]" type="password" value="{$row.device_pwd|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">设备监测物:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="row[type]" class="form-control selectpicker" id="type">
                <option  {if $row.type ==1 } selected {/if} value="1"  >水体</option>
                <option   {if $row.type ==2 } selected {/if} value="2" >气体</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('bindSite')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-site_id" data-rule="required" data-source="hj212/pollutionsite/index" data-field="site_name" class="form-control selectpage" name="row[site_id]"
                   type="text" value="{$row.site_id}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Contact')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-name="contact" data-template="serverinfotpl">
                <dd>
                    <ins>联系人</ins>
                    <ins>联系电话</ins>
                </dd>
                <dd>
                    <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>添加</a>
                </dd>
                <textarea name="contact" class="form-control hide" cols="30" rows="5">{$row.contact}</textarea>
            </dl>
            <!--定义模板-->
            <script type="text/html" id="serverinfotpl">
                <dd class="form-inline">
                    <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control"
                           value="<%=row['name']%>" size="30" placeholder="联系人">
                    <input type="text" name="row[<%=name%>][<%=index%>][tel]" class="form-control"
                           value="<%=row['tel']%>" size="10" placeholder="联系电话" data-rule="mobile">
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span
                        class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            </script>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
